package com.lx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 段誉
 * @create 2019-05-20 11:21
 */
@Controller
public class IndexController {
  @GetMapping
  public String index(Model model, HttpServletRequest request) {
    model.addAttribute("name", "Jacob");
    model.addAttribute("age", 22);
    model.addAttribute("nowDate", new Date());
    request.getSession().setAttribute("context", "Hello,World");
    model.addAttribute("brText", "test<br>hehehe");
    model.addAttribute("jqueryName", "jquery-3.3.1.min.js");
    return "index";
  }
}
